using System;
using System.Collections.Generic;
using System.Text;

namespace ConsoleCommandProcessor
{
    class Program
    {
        static void Main(string[] args)
        {
            string invalidArg = "";
            string path = "";
            string output = "";
            bool displayHelp = false;
            bool invalid = false;
            
            for (int i = 0; i < args.Length; i++)
            {
                CommandLine.Arg arg = CommandLine.ParseArg(args[i]);
                switch (arg.Name)
                {
                    case CommandLine.AvailableArgs.Invalid: invalidArg = arg.Value;
                        invalid = true;
                        break;

                    case CommandLine.AvailableArgs.Path: path = arg.Value;
                        break;

                    case CommandLine.AvailableArgs.Output: output = arg.Value;
                        break;

                    case CommandLine.AvailableArgs.HelpShort:
                    case CommandLine.AvailableArgs.Help: displayHelp = true;
                        break;

                }
            }

            if (args.Length == 0 || displayHelp)
            {
               DisplayHelp();
            }
            else
                if (invalid)
                {
                   DisplayInvalidArgMsg(invalidArg);
                }

            Console.WriteLine("Enter any key to end");
            Console.Read();

        } //end of main()

        private static void DisplayInvalidArgMsg(string invalidArg)
        {
            Console.WriteLine("Invalid argument" + invalidArg);
        }

        private static void DisplayHelp()
        {
            Console.WriteLine("Help content");
        }

    } //end of class

}  //end of namespace
